<template>
  <div>
    <day_picker
      v-model="date"
      value-format="yyyy-MM-dd"
      format="yyyy-MM-dd"
      @change="dateChange"
      placeholder="选择日期"
    >
    </day_picker>
    <div style="float: left;margin-right: 5px;">
        <el-input @keyup.enter.native="select_data()" @change="select_data()" size="mini" placeholder="请输入搜索条件并回车"  v-model="search"/>
    </div>
    <div style="float: right">

      <el-button
        @click="(visible = true), add_alert()"
        type="primary"
        size="mini"
        style="margin-right: 10px"
      >
        <svg-icon style="margin-right: 3px" icon-class="add-circle" />
        添加
      </el-button>
    </div>
    <el-card
      shadow="never"
      :style="{ height: lastHeight + 'px' }"
      style="margin-top: 12px"
    >
      <span slot="header">
        <span style="font-weight: bold">业务需求录入</span>
        <table-change @change="tableSize2 = $event" style="float: right" />
      </span>
      <el-table
        :size="tableSize2"
        :cell-style="({ column }) => column.type === 'index' && 'color:#999999'"
        :data="tableData1"
        :height="lastHeight - 100"
        style="margin-top: -20px"
        @row-click="handleRowClick"
      >
        <el-table-column align="center" label="序号" type="index" width="50">
        </el-table-column>
        <el-table-column prop="unit" height="25" label="业务领域">
        </el-table-column>
        <el-table-column prop="name" label="系统名称"> </el-table-column>
        <el-table-column prop="question" label="问题" :show-overflow-tooltip="true"> </el-table-column>
        <el-table-column prop="difficulties_challenges" :show-overflow-tooltip="true" label="难点与挑战">
        </el-table-column>
        <el-table-column prop="fileid_name_data"  :show-overflow-tooltip="true" label="精细化举措">
          <template slot-scope="scope">
            <el-link target="_blank" :href="scope.row.fileid_url"  :show-overflow-tooltip="true" style="margin-left: 5px" type="primary">{{scope.row.fileid_name_data}}</el-link>
          </template>
        </el-table-column>
        <el-table-column prop="fileid_name_data2"  :show-overflow-tooltip="true" label="数据描述">
          <template slot-scope="scope">
            <el-link target="_blank" :href="scope.row.fileid_name_data2" style="margin-left: 5px" type="primary">{{scope.row.fileid_name_data2}}</el-link>
          </template>
        </el-table-column>
        <el-table-column prop="submitter" label="提交人"> </el-table-column>
        <el-table-column prop="telephone" label="联系电话"> </el-table-column>
        <el-table-column prop="date" label="上传日期"> </el-table-column>
        <el-table-column prop="state" label="状态"> </el-table-column>
        <el-table-column prop="ui_content" :show-overflow-tooltip="true" label="UI交付内容">
          <template slot-scope="scope">
            <el-link target="_blank" :href="scope.row.ui_content"  style="margin-left: 5px" type="primary">{{scope.row.ui_content}}</el-link>
          </template>
        </el-table-column>
        <el-table-column  prop="address" align="center" width="150" label="操作">
          <template  slot-scope="scope">
            <el-link
            :underline="false"
              style="margin-left: 5px"
              type="primary"
              @click=" visible2 = true, kg = true"
              >更多</el-link
            >
            <span style="margin-left: 5px; color: #cccccc">|</span>
            <el-link
            :underline="false"
              style="margin-left: 5px"
              type="primary"
              @click="visible1 = true"
              v-show="scope.row.quanxian"
              >编辑</el-link
            >
            <el-link
            :underline="false"
              style="margin-left: 5px;color:#cccccc"
              type="primary"
              v-show="!scope.row.quanxian"
              >编辑</el-link
            >
            <span style="margin-left: 5px; color: #cccccc">|</span>
            <el-link :underline="false" v-show="scope.row.quanxian" style="margin-left: 5px" @click="doDel" type="danger"
              >删除</el-link
            >
            <el-link :underline="false" v-show="!scope.row.quanxian" style="margin-left: 5px;color:#cccccc" type="danger"
              >删除</el-link
            >
          </template>
        </el-table-column>
      </el-table>
    </el-card>
    <el-dialog width="40%" title="新增" :visible.sync="visible">
      <el-form :model="form">
        <el-row>
          <el-col :span="12">
            <el-form-item label="业务领域" label-width="120px">
              <el-select
                size="mini"
                style="width: 120px"
                v-model="form.unit"
                placeholder="请选择业务领域"
              >
                <el-option
                  v-for="(item, index) in options1"
                  :key="index"
                  :label="item.label"
                  :value="item.value"
                  :disabled="item.disabled"
                >
                </el-option>
              </el-select>
              <!-- <el-tooltip class="item" effect="dark" content="问题导向:定义问题,想解决什么问题" placement="right-start">
                <svg-icon icon-class="help-circle"></svg-icon>
              </el-tooltip> -->
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="系统名称" label-width="120px">
              <el-input
                :style="{ width: inputWidth }"
                placeholder="请输入系统名称"
                size="mini"
                v-model="form.name"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="问题" label-width="120px">
              <el-input
                :style="{ width: inputWidth }"
                placeholder="请输入问题导向"
                size="mini"
                v-model="form.question"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="难点与挑战" label-width="120px">
              <el-input
                :style="{ width: inputWidth }"
                placeholder="请输入难点与挑战"
                size="mini"
                v-model="form.difficulties_challenges"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="提交人" label-width="120px">
              <el-input
                :style="{ width: inputWidth }"
                placeholder="请输入提交人"
                size="mini"
                v-model="form.submitter"
                autocomplete="off"
                :disabled="true"
              ></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="联系电话" label-width="120px">
              <el-input
                :style="{ width: inputWidth }"
                placeholder="请输入联系电话"
                size="mini"
                v-model="form.telephone"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="状态" label-width="120px">
              <el-select
                size="mini"
                style="width: 120px"
                v-model="form.state"
                placeholder="请选择状态"
                :disabled="true"
              >
                <el-option
                  v-for="(item, index) in options"
                  :key="index"
                  :label="item.label"
                  :value="item.value"
                  :disabled="item.disabled"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="日期" label-width="120px">
              <day_picker
                :is-has-button="false"
                v-model="form.date"
                :style="{ width: inputWidth }"
                format="yyyy-MM-dd"
                placeholder="选择日期"
                :disabled="true"
              >
              </day_picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
<!--            <el-form-item label="精细化举措" label-width="120px">-->
<!--              <el-upload-->
<!--                ref="upload"-->
<!--                style="display: inline"-->
<!--                :action="`http://10.6.80.200:8803/filesys/v2/upload/${uuid}`"-->
<!--                :on-remove="handleRemove"-->
<!--                :before-remove="beforeRemove"-->
<!--                :on-success="handleAvatarSuccess"-->
<!--                multiple-->
<!--                :auto-upload="false"-->
<!--                :limit="3"-->
<!--                name="file"-->
<!--                :on-exceed="handleExceed"-->
<!--              >-->
<!--                <el-button type="primary" size="mini">-->
<!--                  <svg-icon style="margin-right: 3px" icon-class="import" />-->
<!--                  导入-->
<!--                </el-button>-->
<!--              </el-upload>-->
<!--            </el-form-item>-->
          </el-col>

          <el-col :span="12">
            <el-form-item label="数据描述" label-width="120px">
              <el-upload
                ref="upload1"
                style="display: inline"
                :action="`http://10.6.80.200:8803/filesys/v2/upload/1234`"
                :on-remove="handleRemove1"
                :before-remove="beforeRemove1"
                :on-success="handleAvatarSuccess1"
                multiple
                :auto-upload="false"
                :limit="3"
                name="file"
                :on-exceed="handleExceed1"
              >
                <el-button type="primary" size="mini">
                  <svg-icon style="margin-right: 3px" icon-class="import" />
                  导入
                </el-button>
              </el-upload>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" @click="visible = false">取 消</el-button>
        <el-button size="mini" @click="upload_files()">上 传</el-button>
        <el-button
          size="mini"
          :loading="confirmLoading"
          type="primary"
          @click="doConfirm"
          >确 定</el-button
        >
      </div>
    </el-dialog>
    <el-dialog width="40%" title="修改" :visible.sync="visible1">
      <el-form :model="form1">
        <el-row>
          <el-col :span="12">
            <el-form-item label="业务领域" label-width="120px">
              <el-select
                size="mini"
                style="width: 120px"
                v-model="form1.unit"
                placeholder="请选择业务领域"
                :disabled="true"

              >
                <el-option
                  v-for="(item, index) in options1"
                  :key="index"
                  :label="item.label"
                  :value="item.value"
                  :disabled="item.disabled"
                >
                </el-option>
              </el-select>
              <!-- <el-tooltip class="item" effect="dark" content="问题导向:定义问题,想解决什么问题" placement="right-start">
                <svg-icon icon-class="help-circle"></svg-icon>
              </el-tooltip> -->
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="系统名称" label-width="120px">
              <el-input
                :style="{ width: inputWidth }"
                placeholder="请输入系统名称"
                size="mini"
                v-model="form1.name"
                autocomplete="off"
                :disabled="true"

              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="问题" label-width="120px">
              <el-input
                :style="{ width: inputWidth }"
                placeholder="请输入问题导向"
                size="mini"
                v-model="form1.question"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="难点与挑战" label-width="120px">
              <el-input
                :style="{ width: inputWidth }"
                placeholder="请输入难点与挑战"
                size="mini"
                v-model="form1.difficulties_challenges"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="提交人" label-width="120px">
              <el-input
                :style="{ width: inputWidth }"
                placeholder="请输入提交人"
                size="mini"
                v-model="form1.submitter"
                autocomplete="off"
                :disabled="true"
              ></el-input>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="联系电话" label-width="120px">
              <el-input
                :style="{ width: inputWidth }"
                placeholder="请输入联系电话"
                size="mini"
                v-model="form1.telephone"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="状态" label-width="120px">
              <el-select
                size="mini"
                style="width: 120px"
                v-model="form1.state"
                placeholder="请选择状态"
              >
                <el-option
                  v-for="(item, index) in options"
                  :key="index"
                  :label="item.label"
                  :value="item.value"
                  :disabled="item.disabled"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="日期" label-width="120px">
              <day_picker
                :is-has-button="false"
                v-model="form1.date"
                :style="{ width: inputWidth }"
                format="yyyy-MM-dd"
                placeholder="选择日期"
                :disabled="true"
              >
              </day_picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="精细化举措" label-width="120px">
              <el-upload
                ref="upload"
                style="display: inline"
                :action="`http://10.6.80.200:8803/filesys/v2/upload/${uuid}`"
                :on-remove="handleRemove"
                :before-remove="beforeRemove"
                :on-success="handleAvatarSuccess"
                multiple
                :auto-upload="false"
                :limit="3"
                name="file"
                :on-exceed="handleExceed"
              >
                <el-button type="primary" size="mini">
                  <svg-icon style="margin-right: 3px" icon-class="import" />
                  导入
                </el-button>
              </el-upload>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="数据描述" label-width="120px">
              <el-upload
                ref="upload1"
                style="display: inline"
                :action="`http://10.6.80.200:8803/filesys/v2/upload/${uuid}`"
                :on-remove="handleRemove1"
                :before-remove="beforeRemove1"
                :on-success="handleAvatarSuccess1"
                multiple
                :auto-upload="false"
                :limit="3"
                name="file"
                :on-exceed="handleExceed1"
              >
                <el-button type="primary" size="mini">
                  <svg-icon style="margin-right: 3px" icon-class="import" />
                  导入
                </el-button>
              </el-upload>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="mini" @click="visible1 = false">取 消</el-button>
        <el-button size="mini" @click="upload_files()">上 传</el-button>
        <el-button
          size="mini"
          :loading="confirmLoading"
          type="primary"
          @click="doConfirm1"
          >确 定</el-button
        >
      </div>
    </el-dialog>
    <el-dialog width="40%" title="详情" :visible.sync="visible2">
      <el-table
        :size="tableSize2"
        :cell-style="({ column }) => column.type === 'index' && 'color:#999999'"
        :data="tableData2"
        :height="lastHeight - 300"
        style="margin-top: -20px"
        highlight-current-row
      >
        <el-table-column align="center" label="序号" type="index" width="50">
        </el-table-column>
        <el-table-column prop="name" label="系统名称"> </el-table-column>
        <el-table-column prop="fileid_name_data"  :show-overflow-tooltip="true" label="文件名称">
          <template slot-scope="scope">
            <!-- <a :href="scope.row.fileid_url" target="_blank" >{{scope.row.fileid_name_data}}</a> -->
            <el-link :href="scope.row.fileid_url" style="margin-left: 5px" type="primary">{{scope.row.fileid_name_data}}</el-link>
          </template>
        </el-table-column>
        <el-table-column prop="type"  :show-overflow-tooltip="true" label="类别">
        </el-table-column>
        <el-table-column prop="date" label="上传时间"> </el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>

<script>
import Print from "@/util/print";
import axios from "axios";
export default {
  name: "demo1",
  data() {
    return {
      confirmLoading: false,
      inputWidth: "180px",
      visible: false,
      visible1: false,
      visible2: false,
      tableSize1: "",
      tableSize2: "",
      date: "",
      form: {
        unit: "",
        name: "",
        question: "",
        difficulties_challenges: "",
        submitter: "",
        telephone: "",
        state: "",
        date: "",
        refined_measures: [],
        data_description: [],
      },
      form1: {
        unit: "",
        name: "",
        question: "",
        difficulties_challenges: "",
        submitter: "",
        telephone: "",
        state: "",
        date: "",
        refined_measures: [],
        data_description: [],
      },
      //表格数据
      tableData1: [],
      //更多->详情
      tableData2: [],
      options: [
        {
          value: "需求待确认",
          label: "需求待确认",
        },

      ],
      options1: [
        {
          value: "财务",
          label: "财务",
        },
        {
          value: "安环",
          label: "安环",
        },
        {
          value: "生产",
          label: "生产",
        },
        {
          value: "铁前",
          label: "铁前",
        },
        {
          value: "钢后",
          label: "钢后",
        },
        {
          value: "质量",
          label: "质量",
        },
        {
          value: "设备",
          label: "设备",
        },
        {
          value: "能源",
          label: "能源",
        },
        {
          value: "经营",
          label: "经营",
        },
        {
          value: "执行力",
          label: "执行力",
        },
      ],
      imageUrl: "",
      fileList: [],
      fileList1: [],
      uuid: "12345",
      card: "",
      chn: "",
      name: "",
      kg:false,
      quanxian:false,
      permissions_it:['220136','220137','220008'],
      permissions_ui:[],
      permissions_admin:['220136'],
      //搜索条件
      search:'',
    };
  },
  methods: {
    doDel() {
      this.$confirm(
        `您确认删除当前内容吗?<div><span style="font-size: 10px">您已选择1条内容</span></div>`,
        "",
        {
          confirmButtonText: "是",
          cancelButtonText: "否",
          dangerouslyUseHTMLString: true,
          type: "warning",
        }
      )
        .then(() => {
          axios("http://10.6.80.144/management_system/delete_1.php", {
            params: {
              // date: this.date,
              name :this.name,
            },
          }).then((res) => {
            this.$message({
              type: "success",
              message: "删除成功!",
            });
            this.select_data();
          });

        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    //查询接口
    select_data() {
      axios("http://10.6.80.144/management_system/select_1.php", {
        params: {
          date: this.date,
          search:this.search,
        },
      }).then((res) => {
        this.tableData1 = res;

        for (let index = 0; index < this.tableData1.length; index++) {
          var quanxian = this.tableData1[index].submitter.match(/\d+/g);
          if((quanxian[0] == this.card) || (this.permissions_admin.indexOf(this.card) != -1)){
            this.tableData1[index]['quanxian'] = true;
          }
        }
      });
    },
    //更多查询接口
    getDetail(){
      axios("http://10.6.80.144/management_system/select_gd_1.php", {
        params: {
          name: this.name,
        },
      }).then((res) => {
        this.tableData2 = res;
      });
    },

    //添加信息内容获取
    doConfirm() {
      //表单验证
      this.form.refined_measures = this.fileList;
      this.form.data_description = this.fileList1;

      if (!this.form.unit) {
        this.$message.warning("请选择业务领域");
        return false;
      }
      if (!this.form.name) {
        this.$message.warning("请输入系统名称");
        return false;
      }
      if (!this.form.question) {
        this.$message.warning("请输入问题导向");
        return false;
      }
      if (!this.form.difficulties_challenges) {
        this.$message.warning("请输入难点及挑战");
        return false;
      }
      if (!this.form.submitter) {
        this.$message.warning("请输入提交人");
        return false;
      }
      if (!this.form.telephone) {
        this.$message.warning("请输入联系电话");
        return false;
      }
      if (!this.form.state) {
        this.$message.warning("请选择状态");
        return false;
      }
      if (!this.form.date) {
        this.$message.warning("请选择日期");
        return false;
      }
      if (this.form.refined_measures.length == 0) {
        this.$message.warning("请提交精细化举措文件");
        return false;
      }
      if (this.form.data_description.length == 0) {
        this.$message.warning("请提交数据描述文件");
        return false;
      }
      //判断文件上传成功
      axios("http://10.6.80.144/management_system/add_1.php", {
        params: {
          user: this.form,
        },
      }).then((res) => {
        console.log(res);
        if(res.code==200){
          this.$message.success("添加成功");
          this.visible = false;
          this.select_data();
          this.form = {
            unit: "",
            name: "",
            question: "",
            difficulties_challenges: "",
            submitter: "",
            telephone: "",
            state: "",
            date: "",
            refined_measures: [],
            data_description: [],
          };
        }else{
          this.$message.error("您上传的系统名称已存在");
        }

      });

      // setTimeout(() => {
      //   this.$message.success(JSON.stringify(this.form));
      //   this.confirmLoading = this.visible = false;
      // }, 2000);
    },
    //修改信息内容获取
    doConfirm1() {
       //表单验证
       this.form1.refined_measures = this.fileList;
      this.form1.data_description = this.fileList1;

      if (!this.form1.unit) {
        this.$message.warning("请选择业务领域");
        return false;
      }
      if (!this.form1.name) {
        this.$message.warning("请输入系统名称");
        return false;
      }
      if (!this.form1.question) {
        this.$message.warning("请输入问题导向");
        return false;
      }
      if (!this.form1.difficulties_challenges) {
        this.$message.warning("请输入难点及挑战");
        return false;
      }
      if (!this.form1.submitter) {
        this.$message.warning("请输入提交人");
        return false;
      }
      if (!this.form1.telephone) {
        this.$message.warning("请输入联系电话");
        return false;
      }
      if (!this.form1.state) {
        this.$message.warning("请选择状态");
        return false;
      }
      if (!this.form1.date) {
        this.$message.warning("请选择日期");
        return false;
      }

      //判断文件上传成功
      axios("http://10.6.80.144/management_system/updata_1.php", {
        params: {
          user: this.form1,
        },
      }).then((res) => {
        console.log(res);
          this.$message.success("修改成功");
        this.visible1 = false;
        this.select_data();
        this.form1 = {
          unit: "",
          name: "",
          question: "",
          difficulties_challenges: "",
          submitter: "",
          telephone: "",
          state: "",
          date: "",
          refined_measures: [],
          data_description: [],
        };
      });
    },
     //点击后获取某一行数据
     handleRowClick(val) {
      this.form1.unit = val.unit;
      this.form1.name = val.name;
      this.form1.question = val.question;
      this.form1.difficulties_challenges = val.difficulties_challenges;
      this.form1.submitter = val.submitter;
      this.form1.telephone = val.telephone;
      this.form1.state = val.state;
      this.form1.date = val.date;
      this.name = val.name;
      //正则获取数字
      if(this.kg){
        this.getDetail();
      }
    },
    print() {
      let el = this.$el;
      console.log(Print(el));
      // .toPrint();
    },
    upload_files() {
      // this.$refs.upload.submit();
      this.$refs.upload1.submit();
    },
    dateChange() {
      this.select_data();
    },
    dateChange2() {
      let date = new Date();
      let year = date.getFullYear();
      let month = date.getMonth() + 1;
      if (month < 10) {
        month = "0" + month;
      }
      let day = date.getDate();
      this.date = year + "-" + month + "-" + day;
    },
    add_alert() {
      let date = new Date();
      let year = date.getFullYear();
      let month = date.getMonth() + 1;
      //获取当前月0补全
      if (month < 10) {
        month = "0" + month;
      }
      let day = date.getDate();
      this.form.state = "需求待确认";
      this.form.date = year + "-" + month + "-" + day;
    },
    //文件上传钩子开始
    handleAvatarSuccess(res, file) {
      this.fileList.push({
        name: file.name,
        url: file.response.url,
        fileId: file.response.fileId,
      });
    },
    handleAvatarSuccess1(res, file) {
      this.fileList1.push({
        name: file.name,
        url: file.response.url,
        fileId: file.response.fileId,
      });
    },
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handleExceed(files, fileList) {
      this.$message.warning(
        `当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${
          files.length + fileList.length
        } 个文件`
      );
    },
    beforeRemove(file, fileList) {
      return this.$confirm(`确定移除 ${file.name}？`);
    },
    handleRemove1(file, fileList) {
      console.log(file, fileList);
    },
    handleExceed1(files, fileList) {
      this.$message.warning(
        `当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${
          files.length + fileList.length
        } 个文件`
      );
    },
    beforeRemove1(file, fileList) {
      return this.$confirm(`确定移除 ${file.name}？`);
    },
    //文件上传钩子结束
    //权限获取
    select(text) {
      // console.log(1);
      var token = this.getQueryString("token");
      // var card=this.getQueryString("card");
      var permission = text; //权限名
      $$.ajax({
        //请求方式
        type: "get",
        //请求的媒体类型
        contentType: "application/json;charset=UTF-8",
        //请求地址
        url:
          "http://so.newsteel.ai:8888/shiro/web/authc/isPermitted?permission=" +
          permission +
          "&token=" +
          token,
        //请求成功
        success: function (result) {
          if (result["permitted"]) {
            console.log("1");
          } else {
            // alert("您的权限不足!请联系管理员添加.");
            //     window.history.go(-2);
          }
        },
      });
    },
    getQueryString(name) {
      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
      var r = window.location.search.substr(1).match(reg);
      if (r != null) {
        return unescape(r[2]);
      }
      return null;
    },
    //文件下载
    download(url, filename) {
      getBlob(url, function (blob) {
        saveAs(blob, filename);
      });

      function getBlob(url, cb) {
        var xhr = new XMLHttpRequest();
        xhr.open("GET", url, true);
        xhr.responseType = "blob";
        xhr.onload = function () {
          if (xhr.status === 200) {
            cb(xhr.response);
          }
        };
        xhr.send();
      }
      function saveAs(blob, filename) {
        if (window.navigator.msSaveOrOpenBlob) {
          navigator.msSaveBlob(blob, filename);
        } else {
          var link = document.createElement("a");
          var body = document.querySelector("body");
          link.href = window.URL.createObjectURL(blob);
          link.download = filename;
          link.style.display = "none";
          body.appendChild(link);
          link.click();
          body.removeChild(link);
          window.URL.revokeObjectURL(link.href);
        }
      }
    },
  },
  computed: {
    documentHeight() {
      return this.$store.getters.documentHeight;
    },
    lastHeight() {
      return this.documentHeight - 130;
    },
  },
  created() {
    this.card = this.getQueryString("card");
    this.uuid=this.card;
    axios("http://10.6.1.198:8888/shiro/web/authc/address", {
      params: {
        user: this.card,
      },
    }).then((res) => {
      this.chn = res.obj.chn;
      this.form.submitter = this.chn + "" + this.card;
    });
    this.dateChange2();
    this.select_data();
  },
};
</script>

<style scoped>
</style>
